package modles

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Identity         string `gorm:"column:identity;type:varchar(36)" json:"identity"`
	Name             string `gorm:"column:name;type:varchar(100)" json:"name"`
	Password         string `gorm:"column:password;type:varchar(32)" json:"password"`
	Phone            string `gorm:"column:phone;type:varchar(11)" json:"phone"`
	Mail             string `gorm:"column:mail;type:varchar(30)" json:"mail"`
	FinishProblemNum int64  `gorm:"column:finish_problem_num" json:"finish_problem_num"`
	SubmitNum        int64  `gorm:"column:submit_num" json:"submit_num"`
	IsAdmin          int    `gorm:"column:is_admin;type:tinyint(1)" json:"is_admin"`
	FollowCount      int64  `gorm:"column:follow_count;type:int" json:"follow_count"`
	FollowerCount    int64  `gorm:"column:follower_count;type:int" json:"follower_count"`
	IsFollow         int    `gorm:"column:is_following;type:tinyint(1)" json:"is_following"`
	WorkCount        int64  `gorm:"column:work_count;type:int" json:"work_count"`
}

func (table *User) TableName() string {
	return "user"
}
